feat: reinstate title_prefix on all matplotlib subplot panel titles#333
Merged
feat: reinstate title_prefix on all matplotlib subplot panel titles#333
Conversation
Analysis classes accept title_prefix: str = None to prefix every subplot panel title (e.g. "VIS " gives "VIS Data", "VIS Signal-To-Noise Map"). This was stored but never applied after a plot refactor. Thread title_prefix from Plotter.title_prefix down through all subplot_* plot functions across imaging, interferometer, quantity, ellipse, galaxies, and adapt paths. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Merged
2 tasks
All `_pf` lambdas now strip trailing whitespace from title_prefix and insert a single space before the panel title, so callers can pass either "VIS" or "VIS " and always get "VIS Data" (not "VISData" or "VIS Data"). The same fix is applied to the `_title` pattern in fit_ellipse_plots.py. PlotterImaging.imaging() and PlotterEllipse.imaging() now forward `title_prefix=self.title_prefix` to `subplot_imaging_dataset` / `subplot_imaging_dataset_list` so that dataset.png panels receive the prefix when a title_prefix is set on the Plotter. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Analysisclasses accepttitle_prefix: str = Noneto prefix every matplotlib subplot panel title (e.g."VIS "gives"VIS Data","VIS Signal-To-Noise Map"etc. for Euclid VIS imaging). This parameter was stored in allAnalysisandPlotterclasses but was never applied after a plot refactor — titles were hardcoded strings in the*_plots.pyfunctions.This PR reinstates the feature by threading
self.title_prefixfrom everyPlottermethod down to everysubplot_*plot function across all dataset types.API Changes
New optional
title_prefix: str = Noneparameter added to allsubplot_*functions. When set, it is prepended to every panel title string before the title is passed toplot_array()/plot_visibilities_1d(). No existing arguments removed or renamed — fully backwards-compatible.See full details below.
Test Plan
python -m pytest test_autogalaxy/ -x)PlotterImaging(image_path=..., title_prefix="VIS ")should prefix all fit subplot titlesFull API Changes (for automation & release notes)
Added (new optional parameter — backwards-compatible)
All functions below gained
title_prefix: str = None. When non-Nonethe prefix is prepended to every subplot panel title.autogalaxy/imaging/plot/fit_imaging_plots.pysubplot_fit(..., title_prefix=None)subplot_of_galaxy(..., title_prefix=None)subplot_fit_imaging_list(..., title_prefix=None)autogalaxy/interferometer/plot/fit_interferometer_plots.pysubplot_fit(..., title_prefix=None)subplot_fit_dirty_images(..., title_prefix=None)subplot_fit_real_space(..., title_prefix=None)autogalaxy/quantity/plot/fit_quantity_plots.py_subplot_fit_array(..., title_prefix=None)subplot_fit(..., title_prefix=None)autogalaxy/galaxy/plot/galaxies_plots.pysubplot_galaxies(..., title_prefix=None)subplot_galaxy_images(..., title_prefix=None)autogalaxy/galaxy/plot/adapt_plots.pysubplot_adapt_images(..., title_prefix=None)autogalaxy/ellipse/plot/fit_ellipse_plots.py_plot_data(..., title_prefix=None)subplot_fit_ellipse(..., title_prefix=None)Changed Behaviour (Plotter methods now forward title_prefix)
All
Plotter.*methods that call the above plot functions now passtitle_prefix=self.title_prefix. No signature changes on the Plotter methods themselves.Migration
No migration needed — all changes are additive with
Nonedefaults.Closes #332
🤖 Generated with Claude Code